﻿namespace Blaze.Editor.UI
{
    using Framework.Pooling;
    using UnityEditor;
    using UnityEngine;

    [CustomEditor(typeof (PoolObject), true)]
    public class PoolObjectInspector : Editor
    {
        public override void OnInspectorGUI()
        {
            Object pool = null;
            var poolObject = (PoolObject) target;
            if (poolObject.PoolId != 0)
                pool = EditorUtility.InstanceIDToObject(poolObject.PoolId);
            EditorGUILayout.Toggle("IsPooled", poolObject.IsPooled);
            EditorGUILayout.ObjectField("Template", pool, typeof (GameObject), false);
        }
    }
}